import requests
from flask import Flask
from flask_restful import Api, Resource, abort, reqparse


class XSubmitServer:
    class Config:
        host = '0.0.0.0'
        port = 80
        debug = False

    class Test(Resource):
        def get(self):
            return "Test data."

    def add_routes(self):
        self.api.add_resource(self.Test, '/test')

    def __init__(self):
        self.app = Flask(__name__)
        self.api = Api(self.app)

        self.add_routes()

    def run(self):
        self.app.run(self.Config.host, port=self.Config.port, debug=self.Config.debug)


if __name__ == '__main__':
    _xsubmit = XSubmitServer()
    _xsubmit.run()
